#include "stdio.h"
#include "stdlib.h"

int main(void) {
     
    FILE *fp = fopen("test.dat","wb");
    double t1 = 3.14;
    fwrite(&t1,sizeof(double),1,fp);
    fclose(fp);

    fp = fopen("test.dat","rb");
    double t2;
    fread(&t2,sizeof(double),1,fp);
    fclose(fp);
    printf("%lf\n",t2);

    return 0;
}